#include "StdAfx.h"
#include "Scene.h"

CScene::CScene(void)
: Camera(0)
{

}

CScene::~CScene(void)
{
	for (size_t i=0;i<Objects.size();++i)
		delete Objects[i];
	Objects.clear();

	for (size_t i=0;i<Lights.size();++i)
		delete Lights[i];
	Lights.clear();
}

void CScene::SetCamera(CCamera* c)
{
	if (Camera)
		delete Camera;
	Camera = c;
}
void CScene::AddObject(CPrimitive* p)
{
	Objects.push_back(p);
}
void CScene::AddLight(CLight* p)
{
	Lights.push_back(p);
}
CCamera* CScene::GetCamera()
{
	return Camera;
}
std::vector<CPrimitive*>& CScene::GetObjects()
{
	return Objects;
}
std::vector<CLight*>& CScene::GetLights()
{
	return Lights;
}